package ArrayTest10_13;

public class Test11 {
    public static void main(String[] args) {
        //定义一个整数数组，判断其中是否有重复的数据
        int[] a = {1, 5, 9, 8, 4, 9};
        int k = 0 ;
        System.out.println("数组为:");
        for (int i :
                a) {
            System.out.print(i + " ");
        }
        System.out.println();
        for (int i = 0; i < a.length-1; i++) {
            for (int j = i+1; j < a.length; j++) {
                if (a[i] == a[j]) {
                    System.out.println("他们有重复的");
                    k++;
                    break;
                }
            }
            if (k > 0) {
                break;
            }
        }
        if (k == 0) {
            System.out.println("没有");
        }




    }
}
